package com.zdd.ehe.service.impl;

import com.zdd.ehe.entity.Log;
import com.zdd.ehe.mapper.LogMapper;
import com.zdd.ehe.service.ILogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ZhuiZhu
 * @since 2023-04-20
 */
@Service
@Slf4j
public class LogServiceImpl extends ServiceImpl<LogMapper, Log> implements ILogService {
    @Resource
    private LogMapper logMapper;

    /**
     * 获取日志列表
     *
     * @return
     */
    @Override
    public List<Log> queryLog() {

        return logMapper.selectList(null);
    }

    /**
     * 新增日志
     *
     * @param log
     * @return
     */
    @Override
    public int insertLog(Log log) {
        System.out.println("log: " + log);
        return logMapper.insert(log);
    }
}
